package com.budwk.app.waterquality.controllers.admin;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.waterquality.models.AppealRecord;
import com.budwk.app.waterquality.services.AppealrecordService;
import com.budwk.app.waterquality.vo.AppealRecordQueryVo;
import com.budwk.starter.common.openapi.annotation.*;
import com.budwk.starter.common.page.PageUtil;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.log.annotation.SLog;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import javax.servlet.http.HttpServletResponse;

@IocBean
@At("/waterquality/admin/appeal/record")
@ApiDefinition(tag = "申诉记录表")
@SLog(tag = "申诉记录表")
@Slf4j
public class AppealrecordController{
    @Inject
    private AppealrecordService wkAppealRecordService;

    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "分页查询申诉记录表")
    public Result<?> listByPage(@Param("..") AppealRecordQueryVo queryVo) {
        return Result.data(wkAppealRecordService.listByPage(queryVo));
    }

    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "申诉记录台账下载")
    public Result<?> downloadAppealLedger (@Param("..") AppealRecordQueryVo queryVo, HttpServletResponse response) {
        return Result.data(wkAppealRecordService.downloadAppealLedger(queryVo, response));
    }



}
